#coding:utf-8
from django.db import models
from django.utils import timezone
from lovewith.account.models import MtUser
from lovewith.supplier.models import Supplier


#供应商店铺每日访问量统计
class ShopAnalytics(models.Model):
    supplier = models.ForeignKey(Supplier, related_name='AnalyticsSupplier', verbose_name=u'供应商')
    user = models.ForeignKey(MtUser, related_name='AnalyticsUser', verbose_name=u'用户')
    views = models.IntegerField(default=0, verbose_name=u'查看数')
    date = models.DateField(default=timezone.now, verbose_name=u'日期')

    def __unicode__(self):
        return self.title

    class Meta:
        verbose_name = u'供应商页面访问统计'
        db_table = 'mt_shop_analytics'